#!/bin/sh
# hooks for nakedeb - executed just before squashfs build

set -e

echo "----"
echo "I: starting nakedeb hooks"
echo "I: update command-not-found"
apt-get update
update-command-not-found

echo "I: urxvtcd as default terminal emulator"
update-alternatives --install /usr/bin/x-terminal-emulator x-terminal-emulator /usr/bin/urxvtcd 90

echo "I: startfluxbox as default session-manager"
update-alternatives --install /usr/bin/x-session-manager x-session-manager /usr/bin/startfluxbox 60

echo "I: disable home admin file"
echo 'Defaults !admin_flag' > /etc/sudoers.d/disable_admin_file_in_home

echo "I: allow alluser for nethogs utility"
setcap "cap_net_admin,cap_net_raw+pe" /usr/sbin/nethogs

echo "I: clear apt cache"
apt-get clean
rm -vr /var/cache/apt/

echo "I: end of nakedeb hooks"
echo "----"
